/**  
 * @Project: TDawn
 * @Title: TestCaseExecutor.java
 * @Package executor
 * @Description: Test Case Executor
 * @author yanglei yanglei1@funshion.com
 * @date 2014年12月16日 上午11:28:58
 * @Copyright: 2014 funshion.com. All rights reserved.
 * @version V1.0  
*/
package executor;

import util.log.LogHelper;
import exception.TestException;

/**
 * @ClassName TestCaseExecutor
 * @Description Test Case Executor
 * @author yanglei1 yanglei1@funshion.com
 * @date 2014年12月16日
 */
public abstract class CaseExecutor {
	
	private static LogHelper logger = new LogHelper(CaseExecutor.class);
	private String caseID = "";
	private String caseName = "";

	public final void execute() throws TestException {
		logger.info("TestCaseExecutor class execute...");
		logger.info("get case name : " + this.getCaseName() + "*******************************************");
		logger.info("get case ID : " + this.getCaseID() + "*********************************************");
		try{
			setUp();
			executeCase();
		} finally {
			tearDown();
		}
	}
	
	protected abstract void setUp() throws TestException;
	protected abstract void executeCase() throws TestException;
	protected abstract void tearDown() throws TestException;
	
	/**
	 * @return the caseID
	 */
	public String getCaseID() {
		return caseID;
	}

	/**
	 * @param caseID the caseID to set
	 */
	public void setCaseID(String caseID) {
		this.caseID = caseID;
	}

	/**
	 * @return the caseName
	 */
	public String getCaseName() {
		return caseName;
	}

	/**
	 * @param caseName the caseName to set
	 */
	public void setCaseName(String caseName) {
		this.caseName = caseName;
	}
}
